# Maintainer: Jürgen Hötzel <juergen@archlinux.org>

_pkgname=result
pkgname=ocaml-${_pkgname}
pkgver=1.5
pkgrel=8
pkgdesc="Compatibility Result module"
arch=('i686' 'x86_64' 'armv7h')
url="https://github.com/janestreet/result"
license=('BSD')
depends=('ocaml')
makedepends=('ocaml-findlib' 'dune')
options=('!strip')
source=("https://github.com/janestreet/result/archive/${pkgver}.tar.gz")
sha256sums=('1072a8b0b35bd6df939c0670add33027f981e4f69a53233cb006b442fa12af30')



build() {
  cd "${srcdir}/${_pkgname}-${pkgver}"
  dune build
}


package() {
  cd "${srcdir}/${_pkgname}-${pkgver}"

  install -dm755 "${pkgdir}$(ocamlfind printconf destdir)"
  dune install --prefix "${pkgdir}/usr" \
    --libdir "${pkgdir}$(ocamlfind printconf destdir)"

  install -Dm644 "LICENSE.md" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.md"
  mv "${pkgdir}/usr/doc" "${pkgdir}/usr/share/"
}
